import 'package:flutter/material.dart';
import 'package:edu/constants/app_strings.dart';
import 'package:edu/utils/account_info.dart';

class SecuritySettingPageLogic extends ChangeNotifier {
  String get phoneNumber {
    return AccountInfo.shared.userProfile?.phoneNumber ?? AppStrings.notBind;
  }

  String get email {
    return AccountInfo.shared.userProfile?.email ?? AppStrings.notBind;
  }

  void _userProfileListener() {
    notifyListeners();
  }

  void init() {
    AccountInfo.shared.userProfileNotifier.addListener(_userProfileListener);
  }

  @override
  void dispose() {
    AccountInfo.shared.userProfileNotifier.removeListener(_userProfileListener);
    super.dispose();
  }
}
